package com.kinptm.masterclock;

import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;

import com.kinptm.masterclock.bean.AlarmClock;
import com.kinptm.masterclock.bean.AlarmRang;
import com.kinptm.masterclock.ui.AlarmClockDetailsActivity;
import com.kinptm.masterclock.ui.AlarmRangActivity;

/**
 * Created by pc on 13-11-11.
 */
public class Intents {
    private Intents() {
    }

    public static void launchAddAlarmClock(Fragment fragment, int requestCode) {
        Intent intent = new Intent(fragment.getActivity(), AlarmClockDetailsActivity.class);
        fragment.startActivityForResult(intent, requestCode);
    }

    public static void launchAddAlarmClock(Fragment fragment, int requestCode, AlarmClock alarmClock) {
        Intent intent = new Intent(fragment.getActivity(), AlarmClockDetailsActivity.class);
        intent.putExtra(ALARM.EXTRA_ALARM_CLOCK, alarmClock);
        fragment.startActivityForResult(intent, requestCode);
    }

    public static void launchAlarmRang(Context context, AlarmRang rang) {
        Intent intent = new Intent(context, AlarmRangActivity.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.putExtra(ALARM.EXTRA_ALARM_RANG, rang);
        context.startActivity(intent);
    }

    public static class ALARM {
        public static final String ACTION_ALARM_SERVICE = "com.kinptm.masterclock.action.ALARM_SERVICE";
        public static final String ACTION_CLOCK_RECEIVER = "com.kinptm.masterclock.action.ALARM_CLOCK_RECEIVER";
        public static final String ACTION_TIMER_RECEIVER = "com.kinptm.masterclock.action.ALARM_TIMER_RECEIVER";


        public static final String EXTRA_ALARM_ACTION = "alarm_action";
        public static final String EXTRA_ALARM_TIME = "alarm_time";

        public static final String EXTRA_ADD_ALARM_CLOCK = "added_alarm_clock";
        public static final String EXTRA_ALARM_ID = "alarm_id";
        public static final String EXTRA_ALARM_RANG = "alarm_rang";
        public static final String EXTRA_ALARM_CLOCK = "alarm_clock";

    }
}
